home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
PROGBLER
/
WASM211B.LZH
/
FILT.DOC
< prev
next >
Wrap
Text File
|
1988-03-07
|
8KB
|
168 lines
FILT Version 1.00
Copyright (c) 1988 Eric Tauck
All Rights Reserved
03/07/1988
FILT is a text filter that performs some low level formatting and
translation functions. Being a filter, FILT does its input and
output through the console device (CON). Input and output files
must be specified with the DOS redirection commands. The basic
syntax is:
FILT options < input_file > output_file
The options consist of single letters and are described below.
The input_file and output_file, in conjunction with the
redirection characters < and >, tell DOS what files to use for
input and output. If no input file is specified, the keyboard
will be used. If no output file is specified, the screen will be
used.
The options are single, case sensitive letters. Any number of
options may be specified. Some of the options are followed by a
number. All numbers are decimal and come immediately after the
option letter (with no intervening spaces). Numbers over 65535
will cause an error.
Summary of options (# denotes number):
Tab Replacement: Tab Assignment:
x = expand tabs to spaces e = erase all tab stops
c = compress spaces to tabs t# = set tab stop
Character Replacement: Line Format:
S = strip high bits m = add left margin
C = strip control chars d = delete left margin
H = strip high (>127) bytes l# = truncate long lines
U = all letters to upper-case r = remove trailing spaces
L = all letters to lower-case b# = byte to end input lines
A = capitalize words s = save carriage returns
End of File: I/O Buffer:
z = ignore ^Z in input i# = input buffer size (20000)
Z = suppress ^Z in output o# = output buffer size (20000)
The following is a full description of all options, listed in
alphabetical order (lower-case first):
? Help. Display a summary of the options.
b# Byte to end input lines. Defines the character that will
identify an end of line (EOL). For instance, b13 will cause
a line to be ended when a carriage return is reached. The
default is b10. This option does not effect how EOL's will
be written, they are always ended with a CR+LF combination.
c Compress spaces to tabs. When possible, spaces will be
replaced by tab characters (ASCII 9). The default tab stops
are every eight columns, but can be set manually with the e
and t options.
d# Delete left margin. The specified number of characters will
be deleted from the left side of all the lines. Any
characters will be deleted. Note that tabs only count as
one character.
e Erase all tab stops. All tab stops will be erased. User
defined tab stops (set with the t option) should come after
the e option.
h Help. Display a summary of the options.
i# Input buffer size. Set the size of the input buffer. The
default is i20000. Making it larger might improve the
processing rate for a slow input device, while making it
smaller will use less memory.
l# Truncate long lines. Lines longer than the specified length
will be truncated. Normally any length lines (up to about
600 characters) are acceptable.
m# Add left margin. The specified number of spaces will be
added to the left margin.
o# Output buffer size. Set the size of the output buffer. The
default is o20000. Making it larger might improve the
processing rate for a slow output device, while making it
smaller will use less memory.
s Save carriage returns. All carriage returns (ASCII 13) are
normally deleted from the input. This option might be
useful in a file that contains line boundaries without
carriage returns, but does contain carriage returns as some
kind of special formatting code.
r Remove trailing spaces. Any spaces (or tabs when using the
c option) that come at the end of lines will be removed.
Spaces at the end of lines, though superfluous, are often
left over from word processors.
t# Set a tab stop. A tab stop will be set at the specified
column number. The first column is number one. Any number
of tab stops may be specified. The default tab stops are
every eight columns, i.e. t9 t17 t25 etc.
x Expand tabs to spaces. All tab characters (ASCII 9) will be
replaced with an equivalent number of spaces. The default
tab stops are every eight columns, but can be set manually
with the e and t options.
z Ignore ^Z in the input file. A ^Z (ASCII 26) normally
identifies the end of a file. If this option is used, the
full number of bytes recorded in the directory will be read.
A Capitalize words. Letters that follow another letter will
be converted to lower-case, all other letters will be
converted to upper-case.
C Strip control characters. All characters below ASCII 32
will be removed.
H Strip high bytes. All characters above ASCII 127 will be
removed.
L Convert all letters to lower-case.
S Strip high bits. The high bit of all bytes above ASCII 127
will be cleared.
U Convert all letters to upper-case.
Z Suppress ^Z in the output file. Normally a ^Z (ASCII 26) is
written to the end of the file. If this option is used, a
^Z will not be written.
The following are some examples of FILT option and file
specifications:
filt ?
Displays a summary of all options to the screen.
filt cr < data.fil > data.new
Means: c = compress spaces to tab characters; and r = remove
trailing spaces. The input file is DATA.FIL and the output
file is DATA.NEW. This combination of options may greatly
reduce the size of a file by compressing or removing
unnecessary spaces.
filt zZCHi500o500 < a:text.xxx > c:\doc\text.txt
Means: z = ignore any input ^Zs; Z = do not write a ^Z to the
end of the file; C = remove all control characters; H = remove
any characters with a value greater than 127; i500 = set the
input buffer size to 500 bytes; and o500 = set the output
buffer size to 500 bytes. The input file is A:TEXT.XXX and
the output file is C:\DOC\TEXT.TXT. This combination of
options converts the input file into a pure ASCII file with no
control characters (except for the line boundaries). Note
that about 39000 fewer bytes of memory are used during
execution because of the buffer sizes, 500+500=1000 instead of
the default 20000+20000=40000.